package zcxn.microService.service;

import java.io.IOException;

import zcxn.microService.bean.BattParamsInfo;
import zcxn.microService.bean.GlobalAllConfigInfo;
import zcxn.microService.bean.SPHParamsInfo;

public class Test {
	
	public static void main(String[] args) throws IOException {
//		String agentId = "25562c127c335d805f69ba57fe92a3a9";
		String agentId = "364ad600f6103b2379178a6dd46a7d51";
//		获取参数信息
		GetConfigParaBean bean=new GetConfigParaBean();
//		全局配置信息
		GlobalAllConfigInfo allConfigInfo=bean.getGlobalAllConfigInfo(agentId);
//		储能信息
		BattParamsInfo batt	=bean.getBattParamsInfo(allConfigInfo.getBattEleInstanceId());
//		SPH参数信息
		SPHParamsInfo sphInfo=bean.getSphParamsInfo(allConfigInfo.getSphEleInstanceId());
//		map生成yaml文件
		MapDataToYaml yaml=new MapDataToYaml();
		yaml.updateYamlInfo(agentId, allConfigInfo, batt,sphInfo);
//		启动脚本
		DoMicroServiceFile d=new DoMicroServiceFile();
		d.writeStartServiceShell(allConfigInfo);
//		将二进制文件复制
		DoMicroServiceFile doMicroServiceFile=new DoMicroServiceFile();
		doMicroServiceFile.copyFileToServiceNameFile(allConfigInfo.getServiceName(),batt.getBatType());
//		tar包的生产
		doMicroServiceFile.tarFiles(allConfigInfo.getServiceName(),allConfigInfo.getGridId()+"");
	}

	

}
